package com.hltc.mtmap.orm;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.hltc.mtmap.MTUser;
import com.hltc.mtmap.MGrain;
import com.hltc.mtmap.MTMyGrain;
import com.hltc.mtmap.MTMessage;
import com.hltc.mtmap.MTMyFavourite;
import com.hltc.mtmap.MFriendStatus;
import com.hltc.mtmap.MFriend;
import com.hltc.mtmap.MTGrain;
import com.hltc.mtmap.MTSite;
import com.hltc.mtmap.MTPhoto;
import com.hltc.mtmap.MTCategory;
import com.hltc.mtmap.MTComment;
import com.hltc.mtmap.MTFavourite;

import com.hltc.mtmap.orm.MTUserDao;
import com.hltc.mtmap.orm.MGrainDao;
import com.hltc.mtmap.orm.MTMyGrainDao;
import com.hltc.mtmap.orm.MTMessageDao;
import com.hltc.mtmap.orm.MTMyFavouriteDao;
import com.hltc.mtmap.orm.MFriendStatusDao;
import com.hltc.mtmap.orm.MFriendDao;
import com.hltc.mtmap.orm.MTGrainDao;
import com.hltc.mtmap.orm.MTSiteDao;
import com.hltc.mtmap.orm.MTPhotoDao;
import com.hltc.mtmap.orm.MTCategoryDao;
import com.hltc.mtmap.orm.MTCommentDao;
import com.hltc.mtmap.orm.MTFavouriteDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig mTUserDaoConfig;
    private final DaoConfig mGrainDaoConfig;
    private final DaoConfig mTMyGrainDaoConfig;
    private final DaoConfig mTMessageDaoConfig;
    private final DaoConfig mTMyFavouriteDaoConfig;
    private final DaoConfig mFriendStatusDaoConfig;
    private final DaoConfig mFriendDaoConfig;
    private final DaoConfig mTGrainDaoConfig;
    private final DaoConfig mTSiteDaoConfig;
    private final DaoConfig mTPhotoDaoConfig;
    private final DaoConfig mTCategoryDaoConfig;
    private final DaoConfig mTCommentDaoConfig;
    private final DaoConfig mTFavouriteDaoConfig;

    private final MTUserDao mTUserDao;
    private final MGrainDao mGrainDao;
    private final MTMyGrainDao mTMyGrainDao;
    private final MTMessageDao mTMessageDao;
    private final MTMyFavouriteDao mTMyFavouriteDao;
    private final MFriendStatusDao mFriendStatusDao;
    private final MFriendDao mFriendDao;
    private final MTGrainDao mTGrainDao;
    private final MTSiteDao mTSiteDao;
    private final MTPhotoDao mTPhotoDao;
    private final MTCategoryDao mTCategoryDao;
    private final MTCommentDao mTCommentDao;
    private final MTFavouriteDao mTFavouriteDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        mTUserDaoConfig = daoConfigMap.get(MTUserDao.class).clone();
        mTUserDaoConfig.initIdentityScope(type);

        mGrainDaoConfig = daoConfigMap.get(MGrainDao.class).clone();
        mGrainDaoConfig.initIdentityScope(type);

        mTMyGrainDaoConfig = daoConfigMap.get(MTMyGrainDao.class).clone();
        mTMyGrainDaoConfig.initIdentityScope(type);

        mTMessageDaoConfig = daoConfigMap.get(MTMessageDao.class).clone();
        mTMessageDaoConfig.initIdentityScope(type);

        mTMyFavouriteDaoConfig = daoConfigMap.get(MTMyFavouriteDao.class).clone();
        mTMyFavouriteDaoConfig.initIdentityScope(type);

        mFriendStatusDaoConfig = daoConfigMap.get(MFriendStatusDao.class).clone();
        mFriendStatusDaoConfig.initIdentityScope(type);

        mFriendDaoConfig = daoConfigMap.get(MFriendDao.class).clone();
        mFriendDaoConfig.initIdentityScope(type);

        mTGrainDaoConfig = daoConfigMap.get(MTGrainDao.class).clone();
        mTGrainDaoConfig.initIdentityScope(type);

        mTSiteDaoConfig = daoConfigMap.get(MTSiteDao.class).clone();
        mTSiteDaoConfig.initIdentityScope(type);

        mTPhotoDaoConfig = daoConfigMap.get(MTPhotoDao.class).clone();
        mTPhotoDaoConfig.initIdentityScope(type);

        mTCategoryDaoConfig = daoConfigMap.get(MTCategoryDao.class).clone();
        mTCategoryDaoConfig.initIdentityScope(type);

        mTCommentDaoConfig = daoConfigMap.get(MTCommentDao.class).clone();
        mTCommentDaoConfig.initIdentityScope(type);

        mTFavouriteDaoConfig = daoConfigMap.get(MTFavouriteDao.class).clone();
        mTFavouriteDaoConfig.initIdentityScope(type);

        mTUserDao = new MTUserDao(mTUserDaoConfig, this);
        mGrainDao = new MGrainDao(mGrainDaoConfig, this);
        mTMyGrainDao = new MTMyGrainDao(mTMyGrainDaoConfig, this);
        mTMessageDao = new MTMessageDao(mTMessageDaoConfig, this);
        mTMyFavouriteDao = new MTMyFavouriteDao(mTMyFavouriteDaoConfig, this);
        mFriendStatusDao = new MFriendStatusDao(mFriendStatusDaoConfig, this);
        mFriendDao = new MFriendDao(mFriendDaoConfig, this);
        mTGrainDao = new MTGrainDao(mTGrainDaoConfig, this);
        mTSiteDao = new MTSiteDao(mTSiteDaoConfig, this);
        mTPhotoDao = new MTPhotoDao(mTPhotoDaoConfig, this);
        mTCategoryDao = new MTCategoryDao(mTCategoryDaoConfig, this);
        mTCommentDao = new MTCommentDao(mTCommentDaoConfig, this);
        mTFavouriteDao = new MTFavouriteDao(mTFavouriteDaoConfig, this);

        registerDao(MTUser.class, mTUserDao);
        registerDao(MGrain.class, mGrainDao);
        registerDao(MTMyGrain.class, mTMyGrainDao);
        registerDao(MTMessage.class, mTMessageDao);
        registerDao(MTMyFavourite.class, mTMyFavouriteDao);
        registerDao(MFriendStatus.class, mFriendStatusDao);
        registerDao(MFriend.class, mFriendDao);
        registerDao(MTGrain.class, mTGrainDao);
        registerDao(MTSite.class, mTSiteDao);
        registerDao(MTPhoto.class, mTPhotoDao);
        registerDao(MTCategory.class, mTCategoryDao);
        registerDao(MTComment.class, mTCommentDao);
        registerDao(MTFavourite.class, mTFavouriteDao);
    }

    public void clear() {
        mTUserDaoConfig.getIdentityScope().clear();
        mGrainDaoConfig.getIdentityScope().clear();
        mTMyGrainDaoConfig.getIdentityScope().clear();
        mTMessageDaoConfig.getIdentityScope().clear();
        mTMyFavouriteDaoConfig.getIdentityScope().clear();
        mFriendStatusDaoConfig.getIdentityScope().clear();
        mFriendDaoConfig.getIdentityScope().clear();
        mTGrainDaoConfig.getIdentityScope().clear();
        mTSiteDaoConfig.getIdentityScope().clear();
        mTPhotoDaoConfig.getIdentityScope().clear();
        mTCategoryDaoConfig.getIdentityScope().clear();
        mTCommentDaoConfig.getIdentityScope().clear();
        mTFavouriteDaoConfig.getIdentityScope().clear();
    }

    public MTUserDao getMTUserDao() {
        return mTUserDao;
    }

    public MGrainDao getMGrainDao() {
        return mGrainDao;
    }

    public MTMyGrainDao getMTMyGrainDao() {
        return mTMyGrainDao;
    }

    public MTMessageDao getMTMessageDao() {
        return mTMessageDao;
    }

    public MTMyFavouriteDao getMTMyFavouriteDao() {
        return mTMyFavouriteDao;
    }

    public MFriendStatusDao getMFriendStatusDao() {
        return mFriendStatusDao;
    }

    public MFriendDao getMFriendDao() {
        return mFriendDao;
    }

    public MTGrainDao getMTGrainDao() {
        return mTGrainDao;
    }

    public MTSiteDao getMTSiteDao() {
        return mTSiteDao;
    }

    public MTPhotoDao getMTPhotoDao() {
        return mTPhotoDao;
    }

    public MTCategoryDao getMTCategoryDao() {
        return mTCategoryDao;
    }

    public MTCommentDao getMTCommentDao() {
        return mTCommentDao;
    }

    public MTFavouriteDao getMTFavouriteDao() {
        return mTFavouriteDao;
    }

}
